﻿<select id="componentList" onchange="Comp_OnChange();">
    <option value="comp_Aggregate">Aggregate</option>
    <option value="comp_Alias">Alias</option>
    <option value="comp_AndOr">AndOr</option>
    <option value="comp_Bool">Bool</option>
    <option value="comp_Compare">Compare</option>
    <option value="comp_ConstCaps">ConstCaps</option>
    <option value="comp_Date">Date</option>
    <option value="comp_DateNumber">DateNumber</option>
    <option value="comp_Day">Day</option>
    <option value="comp_Def">Def</option>
    <option value="comp_Email">Email</option>
    <option value="comp_Env">Env</option>
    <option value="comp_Fail">Fail</option>
    <option value="comp_FileExt">FileExt</option>
    <option value="comp_FileIO">FileIO</option>
    <option value="comp_Fluent Functions">Fluent Functions</option>
    <option value="comp_Fluent Members">Fluent Members</option>
    <option value="comp_Function Wildcard">Function Wildcard</option>
    <option value="comp_HashComment">HashComment</option>
    <option value="comp_Holiday">Holiday</option>
    <option value="comp_Linq">Linq</option>
    <option value="comp_Log">Log</option>
    <option value="comp_MachineInfo">MachineInfo</option>
    <option value="comp_Marker">Marker</option>
    <option value="comp_Money">Money</option>
    <option value="comp_Percent">Percent</option>
    <option value="comp_Print">Print</option>
    <option value="comp_Records">Records</option>
    <option value="comp_Repeat">Repeat</option>
    <option value="comp_Round">Round</option>
    <option value="comp_Run">Run</option>
    <option value="comp_Set">Set</option>
    <option value="comp_Sort">Sort</option>
    <option value="comp_Step">Step</option>
    <option value="comp_Suffix">Suffix</option>
    <option value="comp_Swap">Swap</option>
    <option value="comp_Time">Time</option>
    <option value="comp_TypeOf">TypeOf</option>
    <option value="comp_Units">Units</option>
    <option value="comp_Uri">Uri</option>
    <option value="comp_VariablePath">VariablePath</option>
    <option value="comp_Version">Version</option>
    <option value="comp_Words">Words</option>
</select>
<input type="button" class="actionbutton" name="hideall" value="hide" onclick="Comp_HideLast();" />

<div id="comp_container">
    <div id="components">
        <div id="comp_Aggregate" class="comp" style="display:none" >
    <div class="comp_name">Aggregate</div>
    <div class="comp_desc">Provides sum, min, max, avg, count aggregate functions for lists.</div>
    <pre class="brush: js">
	
// Aggregate plugin allows sum, min, max, avg, count aggregate functions to 
// be applied to lists of objects.

var numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9];
var result = 0;

// Example 1: Using format sum of &lt;expression&gt;
result = sum of numbers;
result = avg of numbers;
result = min of numbers;
result = max of numbers;
result = count of numbers;

// Example 2: Using format sum(&lt;expression&gt;)
result = sum( numbers );
result = avg( numbers );
result = min( numbers );
result = max( numbers );
result = count( numbers );    
	</pre>
</div><div id="comp_Alias" class="comp" style="display:none" >
    <div class="comp_name">Alias</div>
    <div class="comp_desc">Provides using an alias for a keyword such as set for var inside a script.</div>
    <pre class="brush: js">
	
// Alias plugin allows setting up alias of words to other words/tokens in a script

alias def to function
alias set to var

// After the alias configured
set result1 = 1
var result2 = 2
	</pre>
</div><div id="comp_AndOr" class="comp" style="display:none" >
    <div class="comp_name">AndOr</div>
    <div class="comp_desc">Provides words "and" "or" to be used in place of && and ||</div>
    <pre class="brush: js">
	
// AndOr plugin allows the words &quot;and&quot; &quot;or&quot; to be used in place of &amp;&amp; ||

if ( i &gt; 30 and j &lt; 20 ) then print works
if ( i &lt; 30 or  j &gt; 20 ) then print works        
    
	</pre>
</div><div id="comp_Bool" class="comp" style="display:none" >
    <div class="comp_name">Bool</div>
    <div class="comp_desc">Provides synonyms yes/no, on/off for bool values true/false.</div>
    <pre class="brush: js">
	
// Bool plugin allows aliases for true/false

var result = on;
var result = off;
var result = yes;
var result = no;
	</pre>
</div><div id="comp_Compare" class="comp" style="display:none" >
    <div class="comp_name">Compare</div>
    <div class="comp_desc">Provides synonyms for comparison operators</div>
    <pre class="brush: js">
	    
// Compare plugin allows word aliases for the comparison operators. See list below
// 
// ALIAS:                FOR:
// &quot;less than&quot;,          &quot;&lt;&quot; 
// &quot;before&quot;,             &quot;&lt;&quot; 
// &quot;below&quot;,              &quot;&lt;&quot; 
// &quot;is below&quot;,           &quot;&lt;&quot; 
// &quot;is before&quot;,          &quot;&lt;&quot;
// &quot;more than&quot;,          &quot;&gt;&quot; 
// &quot;after&quot;,              &quot;&gt;&quot; 
// &quot;above&quot;,              &quot;&gt;&quot; 
// &quot;is after&quot;,           &quot;&gt;&quot; 
// &quot;is above&quot;,           &quot;&gt;&quot; 
// &quot;less than equal&quot;,    &quot;&lt;=&quot;
// &quot;less than equal to&quot;, &quot;&lt;=&quot;
// &quot;more than equal&quot;,    &quot;&gt;=&quot;
// &quot;more than equal to&quot;, &quot;&gt;=&quot;
// &quot;is&quot;,                 &quot;==&quot;
// &quot;is equal&quot;,           &quot;==&quot;
// &quot;is equal to&quot;,        &quot;==&quot;
// &quot;equals&quot;,             &quot;==&quot;
// &quot;equal to&quot;,           &quot;==&quot;
// &quot;not&quot;,                &quot;!=&quot;
// &quot;not equal&quot;,          &quot;!=&quot;
// &quot;not equal to&quot;,       &quot;!=&quot;
// &quot;is not&quot;,             &quot;!=&quot;
// &quot;is not equal to&quot;,    &quot;!=&quot; 

// Example 1: Using &lt;
if a less than b then
if a before b    then 
if a below  b    then
if a is before b then
if a is below b  then

// Example 2: Using &lt;=
if less than equal then
if less than equal to then

// Example 2: Using &gt;
if a more than b then
if a after b     then 
if a above b     then
if a is after b  then
if a is above b  then    
	</pre>
</div><div id="comp_ConstCaps" class="comp" style="display:none" >
    <div class="comp_name">ConstCaps</div>
    <div class="comp_desc">Allows defining constants with UPPERCASE letters.</div>
    <pre class="brush: js">
	
// Const caps plugin allows the creation of constants using capital letters
// Constants are defined if all the letters are uppercase

// Example 1
MIN_SIZE = 10
MAX_SIZE = 20

// Example 2 : Multiple declarations with different constants.
FIXED = true, DUE_DATE = &quot;2012-5-10&quot;

// Example 3 : Using constants with other plugins ( Date, DateNumber )
STARTS = 3/10/2012
ENDS   = June 10th 2012

// KNOWN ISSUE: Constants should be limited to numbers, bool, strings,
// but right now there is a bug where a constant can be assigned a date.
	</pre>
</div><div id="comp_Date" class="comp" style="display:none" >
    <div class="comp_name">Date</div>
    <div class="comp_desc">Provides word based representation for dates e.g December 21st 2011</div>
    <pre class="brush: js">
	
// Date plugin allows date expressions in a friendly format like January 1 2001;
// Following formats are supported.

var date = January 1st 2012;
var date = Jan
date = jan 10
date = Jan 10 2012
date = Jan 10, 2012
date = Jan 10th
date = Jan 10th 2012
date = Jan 10th, 2012
date = January 10
date = January 10, 2012
date = January 10th
date = January 10th, 2012
date = January 10th 2012 at 9:20 am; 

if today is before December 25th 2011 then
    print Still have time to buy gifts
	</pre>
</div><div id="comp_DateNumber" class="comp" style="display:none" >
    <div class="comp_name">DateNumber</div>
    <div class="comp_desc">Provides representation of dates in the form of numbers e.g. 1/27/2012</div>
    <pre class="brush: js">
	
// Date number plugin allow you to specify dates in the form of numbers as 
// samples below.
// The separator between months/days/years can be &quot;/&quot;, &quot;-&quot;, &quot;\&quot;

var date1 = 1/27/1978;
var date2 = 4-20-1979 at 4:30pm;
var date3 = 6\10\2012 at 7:45am;
	</pre>
</div><div id="comp_Day" class="comp" style="display:none" >
    <div class="comp_name">Day</div>
    <div class="comp_desc">Provides alias and word based representation for days e.g Tuesday, Saturday, today, tommorrow </div>
    <pre class="brush: js">
	
// Day plugin allows days of the week to be used as words. 
// lowercase and uppercase days are supported:
// 1. Monday - Sunday
// 2. monday - sunday
// 3. today, tomorrow, yesterday

var day = Monday;
var date = tomorrow at 3:30 pm;

if tommorrow is Saturday then
    print Thank god it&apos;s Friday
	</pre>
</div><div id="comp_Def" class="comp" style="display:none" >
    <div class="comp_name">Def</div>
    <div class="comp_desc">Allows the word "def" to be used instead of "function" when declaring functions. </div>
    <pre class="brush: js">
	
// Def plugin allows the word &quot;def&quot; to be used instead of &quot;function&quot; when declaring functions.
    
def add( a, b ) 
{ 
    return a + b
}
	</pre>
</div><div id="comp_Email" class="comp" style="display:none" >
    <div class="comp_name">Email</div>
    <div class="comp_desc">Provides using emails without quotes such as john.doe@company.com</div>
    <pre class="brush: js">
	
// Email plugin enables recognition of emails as strings without using quotes,
// such as john.doe@company.com

email1 = john.doe@company.com
email2 = batman2012@gotham.com
email3 = super.man_1@metropolis.com
	</pre>
</div><div id="comp_Env" class="comp" style="display:none" >
    <div class="comp_name">Env</div>
    <div class="comp_desc">Provides access to environment variables</div>
    <pre class="brush: js">
	
// Env plugin allows direct access to environment variables via the &quot;env&quot; object.

// Example 1: Access to user variables only via the &quot;.user&quot; property of env.
result = env.user.path;

// Example 2: Access to system variables via the &quot;.sys&quot; property of env.
result = env.sys.path;

// Example 3: Access to environment variable without specifying sys or user.
result = env.path;
result = env.SystemRoot;
	</pre>
</div><div id="comp_Fail" class="comp" style="display:none" >
    <div class="comp_name">Fail</div>
    <div class="comp_desc">Terminates a program abruptly with a message.</div>
    <pre class="brush: js">
	
// Terminates a program abruptly with a message.

fail &apos;settings file not found, exiting application&apos;

fail &quot;file : #{path} not found, exiting application&quot;

fail 0
	</pre>
</div><div id="comp_FileExt" class="comp" style="display:none" >
    <div class="comp_name">FileExt</div>
    <div class="comp_desc">Allows represnting file extension with out having to surround them in quotes e.g. .xml, .doc, *.dll</div>
    <pre class="brush: js">
	

// Allows represnting file extension with out having to surround them in quotes
// e.g. such as .doc, or *.doc 

// Format: &quot;*&quot; &quot;.&quot; &lt;extension_name&gt;
// NOTE: The &quot;*&quot; is optional.

some_file_operation( &apos;c:\\app\\src\\&apos;, .pdb )
some_file_operation( &apos;c:\\app\\src\\&apos;, *.dll )
some_file_operation( &apos;c:\\app\\src\\&apos;, .svn )
some_file_operation( &apos;c:\\app\\src\\&apos;, .exe )
	</pre>
</div><div id="comp_FileIO" class="comp" style="display:none" >
    <div class="comp_name">FileIO</div>
    <div class="comp_desc">Provides basic File/Directory operations.</div>
    <pre class="brush: js">
	 
 // Provides basic File/Directory operations.
      
 // Case 1: Fluent-mode ( files ) - with Uri plugin and FluentMember plugin
 create   file  c:\temp\fs.txt   contents: &apos;testing&apos;
 append   file  c:\temp\fs.txt   contents: &apos;testing&apos;
 copy     file  c:\temp\fs.txt   to: c:\temp\fs.log
 move     file  c:\temp\fs.txt   to: c:\temp\fs2.txt
 rename   file  c:\temp\fs.txt   to: &apos;fs1.txt&apos;
 delete   file  c:\temp\fs.txt 
 var exists = file exists c:\temp\fs.txt
 
  
 // Case 2: Fluent-mode ( directories ) - with Uri plugin and FluentMember plugin
 create   dir   c:\temp\fs
 copy     dir   c:\temp\fs,       to: c:\temp\fs1
 move     dir   c:\temp\fs2,      to: c:\temp\fs
 rename   dir   c:\temp\fs1,      to: &apos;fs2&apos;
 delete   dir   c:\temp\fs
 var exists = dir exists       c:\temp\fs 
 

 // Case 3: Files  ( Explicit calls )
 File.Create( &apos;c:\\build\\log.txt&apos;, &apos;contents&apos; )
 File.Append( &apos;c:\\build\\log.txt&apos;, &apos;contents&apos; )
 File.Copy  ( &apos;c:\\build\\log.txt&apos;, &apos;c:\\build\\file2.txt&apos;)
 File.Rename( &apos;c:\\temp\\fs.txt&apos;,  &apos;fs-io-test2.txt&apos;, true );
 File.Delete( &apos;c:\\temp\\fs.txt&apos; )
 File.Move  ( &apos;c:\\temp\\fs.txt&apos;,  &apos;c:\\temp\\fs-io-test.txt&apos; )
 

 // Case 4: Directories ( Explicit calls )
 // NOTE: This is similar to case 3 where each call is &quot;Dir.&lt;method&gt;( &lt;paramlist&gt; )&quot;
 
	</pre>
</div><div id="comp_Fluent Functions" class="comp" style="display:none" >
    <div class="comp_name">Fluent Functions</div>
    <div class="comp_desc">Provides ability to call functions with spaces in name. e.g. refill inventory</div>
    <pre class="brush: js">
	
// Fluent Func plugins allows calling functions with spaces.
 

// @@summary: finds doctors based on the zip code provided and 
// the specicality and accepted insurance
// @@arg: name: zip,       type: number, desc: The zipcode, examples: 11201
// @@arg: name: specialty, type: text,   desc: Specialization, examples: &apos;Familye&apos;
// @@arg: name: insurance, type: text,   desc: Name of insurance, examples: &apos;empire&apos;
function find_doctors_by_zipcode ( zip, specialty, insurance )
{
    // ... some code here.
}


// @@arg: name: product, desc: The product id,  type: text, examples: &apos;AS-1232&apos;
// @@arg: name: amount,  desc: Number of items, type: text, examples: 23
function refill_inventory( product, amount )
{
    // ... some code here.
}


// Call functions replacing &quot;_&quot; with space - parameters are optional if function call
// is on a single line.

// Example 1:
find doctors by zipcode 11200, &apos;family practice&apos;, &apos;empire insurance&apos;
 
// Example 2:
refill inventory &apos;KL-131&apos;, 200
	</pre>
</div><div id="comp_Fluent Members" class="comp" style="display:none" >
    <div class="comp_name">Fluent Members</div>
    <div class="comp_desc">Provides ability to access properties and methods on a custom c# object without the 
            "."( dot operator ).</div>
    <pre class="brush: js">
	 
 // Fluent Member plugin allows properties and methods to be accessed without &quot;.&quot;

 // Supported ways of calling methods:
 // 1. class     property    
 // 2. class     method      
 // 3. instance  property
 // 4. instance  method 
 // 5. prop      class       
 // 6. prop      instance    
 // 7. method    class       
 // 8. method    instance
 
 // NOTE: In the above list &quot;class&quot; designates access to class level/static members
  
 
 // FLUENT CALLS
 // Example 1 : method instance
 activate user &apos;kreddy&apos;   
  
 // Example 2 : method class arg
 delete file c:\temp.txt
 
 // Example 3 : class method arg
 file exists c:\temp.txt
 
	</pre>
</div><div id="comp_Function Wildcard" class="comp" style="display:none" >
    <div class="comp_name">Function Wildcard</div>
    <div class="comp_desc">Provides a 'wildcard' like ability to functions so that 2 functions that have different names are
            associated with the same function.
            </div>
    <pre class="brush: js">
	
// FuncWildCard plugin allows using functions with changing names allowing
// a single function to handle function calls with different names.
 

// @@summary: A single function can be called using wildcards
// @@arg name: wildcard,  type: string, example: &quot;by name password email role&quot;
// @@arg name: wildcardParts, type: list, example: [&apos;by&apos;, &apos;name&apos; &apos;password&apos;, &apos;email&apos;, &apos;role&apos; ]
// @@arg name: args, type: list, example: [ &apos;kreddy&apos;, &apos;admin&apos; ]
function &quot;create user by&quot; * ( wildcard, wildcardParts, args ) 
{
    person = new Person()
    
    // Option 1: Use the full name to determine what to do
    if wildcard== &quot;name password email role&quot; 
    {
        person.Name = args[0]
        person.Password = args[1]
        person.Email = args[2]
        person.Role = args[3]
    }
    
    // Option 2: Use the individual name parts
    for( var ndx = 0; ndx &lt; wildcardParts.length; ndx++)
    {
                part = wildcardParts[ndx]

        if part == &quot;name&quot; then person.Name = args[ndx]
        else if part == &quot;password&quot; then person.Password = args[ndx]
        else if part == &quot;email&quot;    then person.Email = args[ndx]
        else if part == &quot;role&quot;     then person.Role = args[ndx]
    }
    person.Save()
}


create user by name email ( &quot;user02&quot;, &quot;user02@abc.com&quot; )
create user by name password email role ( &quot;user01&quot;, &quot;password&quot;, &quot;user01@abc.com&quot;, &quot;user&quot; )
	</pre>
</div><div id="comp_HashComment" class="comp" style="display:none" >
    <div class="comp_name">HashComment</div>
    <div class="comp_desc">Provides single line comment using # instead of //</div>
    <pre class="brush: js">
	
// Allows using # for single line comments instead of //

#  Single line comment 

// Also single line comment
	</pre>
</div><div id="comp_Holiday" class="comp" style="display:none" >
    <div class="comp_name">Holiday</div>
    <div class="comp_desc">Provides holiday names e.g. Christmas, Independence Day, Christmas Eve, New Years</div>
    <pre class="brush: js">
	
// Holiday plugin allows references to dates using Holiday names such as:
// Christmas
// Independence day
// Valentines day
// New Years

if today is New Years 2012 then 
    print happy new year!
	</pre>
</div><div id="comp_Linq" class="comp" style="display:none" >
    <div class="comp_name">Linq</div>
    <div class="comp_desc">Provides partial support for linq-like queries on lists.</div>
    <pre class="brush: js">
	
// Linq plugin is a Light-weight and partial version of Linq style queries and comprehensions
// NOTE: This has limited functionality as of this release.
var books = [ 
                { name: &apos;book 1&apos;, pages: 200, author: &apos;homey&apos; },
                { name: &apos;book 2&apos;, pages: 120, author: &apos;kdog&apos; },
                { name: &apos;book 3&apos;, pages: 140, author: &apos;homeslice&apos; }
            ];
 
// Case 1: start with source &lt;books&gt; and system auto creates variable &lt;book&gt;
var favorites = books where book.pages &lt; 150 and book.author == &apos;kdog&apos;;

// Case 2: using from &lt;variable&gt; in &lt;source&gt;
var favorities = from book in books where book.pages &lt; 150 and book.author == &apos;kdog&apos;;
	</pre>
</div><div id="comp_Log" class="comp" style="display:none" >
    <div class="comp_name">Log</div>
    <div class="comp_desc">Provides logging ability to either the console or a log file</div>
    <pre class="brush: js">
	

// CONFIGURATION    
// 1. Set level to &quot;error&quot; and log to console
log.configure( &apos;error&apos;, &apos;console&apos; )

// 2. Fluen mode, set level = &quot;error&quot; and log to console.
log configure &apos;error&apos;, &apos;console&apos;

// 3. File logging: set level to &quot;warn&quot; and log to file
log configure &apos;warn&apos;, &apos;c:/temp/myapp.log&apos;

// 4. File logging: set level to &quot;warn&quot; and log to file with a name format.
// log file name will be converted to &quot;myapp-2012-07-15-time-09-45-12.log&quot;
log configure &apos;warn&apos;, &apos;c:/temp/myapp.log&apos;, &apos;${yyyy-MM-dd}-time-${HH-mm-ss}&apos;

// 5. Get the current log level : this is only a getter property
print( log.level )


// LOGGING   
// 1. Using OO ( object oriented ) syntax e.g. &quot;log.&lt;method&gt;&quot;
log.error( &apos;an error occurred&apos; )

// 2. Using OO syntax with formatting
log.warn( &apos;could not load {0}&apos;, &apos;blogs&apos; )

// 3. Using OO syntax in fluent mode
log info &apos;finished updating data&apos;

// 4. functional mode - without prefixing with &quot;log.&quot;
error &apos;unable to initialize&apos;
warn &apos;could not send notification&apos;
info &apos;finished updating data&apos;

// NOTES: Log-level
// 1. fatal
// 2. error
// 3. warn
// 4. info
// 5. debug
// 6. put   ( this will always output the log message )    
	</pre>
</div><div id="comp_MachineInfo" class="comp" style="display:none" >
    <div class="comp_name">MachineInfo</div>
    <div class="comp_desc">Provides markers/comments that are checked for syntax</div>
    <pre class="brush: js">
	
// Machine info plugin provides variable names to get information about the machine
    
print ( @@machine        )
print ( @@domain         )
print ( @@user           )
print ( @@cmdline        )

print ( mac.numprocs    )
print ( mac.osname      )
print ( mac.osversion   )
print ( mac.osspack     )

print ( mac sysdir      )
print ( mac memory      )
print ( mac version     )
print ( mac currentdir  )  

// NOTES:
// Any of the properties above can be prefixed with either
// 1. mac.&lt;property&gt;
// 2. mac &lt;property&gt;
// 3. @@&lt;property&gt;
	</pre>
</div><div id="comp_Marker" class="comp" style="display:none" >
    <div class="comp_name">Marker</div>
    <div class="comp_desc">Provides markers/comments that are checked for syntax</div>
    <pre class="brush: js">
	
// Marker plugin allows you to mark code like comments but in the form of statements
// so that syntax is checked. This allows for structured comments.

// Case1 : Todo
@@todo: i need to add extra comments here

// Case2 : Todo quoted
@@todo: &quot;I need to add extra checks here and
also do additional cleanup of code&quot;

// Case 3 : bug
@@bug: &apos;this bug related to parsing&apos;
@@bug: this bug related to johns code!
	</pre>
</div><div id="comp_Money" class="comp" style="display:none" >
    <div class="comp_name">Money</div>
    <div class="comp_desc">Provides dollar sign $ support for numbers.</div>
    <pre class="brush: js">
	
// Money plugin simply allows the $ to be prefixed to numbers.

var salary = $225.50;
if salary is more than $160 then
    print I worked overtime.
	</pre>
</div><div id="comp_Percent" class="comp" style="display:none" >
    <div class="comp_name">Percent</div>
    <div class="comp_desc">Provides using a percent sign % after a number to indicate percentage</div>
    <pre class="brush: js">
	
// Percent plugin allow using a percent sign % after a number to indicate percentage
 
a = 25%
b = 75 %
 
// NOTES
// 1. You can not use this when an identifier comes after the &quot;%&quot;
// 2. You can not use this when another number comes after the &quot;%&quot;
	</pre>
</div><div id="comp_Print" class="comp" style="display:none" >
    <div class="comp_name">Print</div>
    <div class="comp_desc">Provides functionality to print to console a line of text without wrapping around quotes.</div>
    <pre class="brush: js">
	
// Print plugin derives from the &quot;TakeoverPlugin&quot;
// Takeovers are keywords that consume the entire line of text in the script
// after the keyword. 
// In this case of the Print plugin, it consume the rest of the line and you
// don&apos;t need to wrap text around quotes.

var language = &apos;fluentscript&apos;;
print No need for quotes in #{language} if text to print is on one line    
	</pre>
</div><div id="comp_Records" class="comp" style="display:none" >
    <div class="comp_name">Records</div>
    <div class="comp_desc">Supports representing data in a table/csv like format.</div>
    <pre class="brush: js">
	   
   // Supports representing data in a table/csv like format
   // 1. The top most row must the the header names without spaces
   // 2. The header names must be separated by &quot;|&quot;
   // 3. The columns in the data rows must be separated by either &quot;|&quot; or &quot;,&quot;
   
   set books1 = [  
                    name          |     pages   |  artist
                    &apos;batman&apos;     |     110     |  &apos;john&apos;
                    &apos;xmen&apos;       |     120     |  &apos;lee&apos;
                    &apos;daredevil&apos;  |     140     |  &apos;maleev&apos;
                ];
    
    
    set books2 = [  
                    name          |     pages   |  artist
                    &apos;batman&apos;     ,     110     ,  &apos;john&apos;
                    &apos;xmen&apos;       ,     120     ,  &apos;lee&apos;
                    &apos;daredevil&apos;  ,     140     ,  &apos;maleev&apos;
                 ];
	</pre>
</div><div id="comp_Repeat" class="comp" style="display:none" >
    <div class="comp_name">Repeat</div>
    <div class="comp_desc">Repeat plugin provides convenient ways to execute loops.</div>
    <pre class="brush: js">
	
// Repeat plugin provides convenient ways to execute loops.        

// Case 1: for(it = 1; it &lt;= 10; it++ )
repeat to 10 
    print &quot;hi&quot;


// Case 2: for(it = 2; it &lt;= 10; it++ )        
repeat 2 to 10 
    print &quot;hi&quot;


// Case 3: for(it = 2; it &lt; 10; it++ )    
repeat 2 to &lt; 10 
    print &quot;hi&quot;


// Case 4: for(it = 2; it &lt; 10; it+= 2 )    
repeat 2 to &lt; 10 by 2
    print &quot;hi&quot;


// Case 5: for( ndx = 0; ndx &lt;= 10; ndx++ )
repeat ndx to 10
    print &quot;hi&quot;


// Case 6: for( ndx = 0; ndx &lt; 10; ndx++ )
repeat ndx to &lt; 10
    print &quot;hi&quot;


// Case 7: for( ndx = 1; ndx &lt;= 10; ndx++ )
repeat ndx = 1 to 10
    print &quot;hi&quot;


// Case 8: for( ndx = 1; ndx &lt; 10; ndx++ )
repeat ndx = 1 to &lt; 10
    print &quot;hi&quot;


// Case 9: for( ndx = 1; ndx &lt; 10; ndx+= 2)
repeat ndx = 1 to &lt; 10 by 2
    print &quot;hi&quot;
	</pre>
</div><div id="comp_Round" class="comp" style="display:none" >
    <div class="comp_name">Round</div>
    <div class="comp_desc">Provides rounding of numbers using round, round up, round down.</div>
    <pre class="brush: js">
	

// Round plugin provides functions to round, round up or round down numbers.

var a = 2.3;

// Rounds the number using standing round technique of .4
var b = round 2.3;

// Gets rounded up to 3
var c = round up 2.3; 

// Gets rounded down to 2
var d = round down 2.3;
	</pre>
</div><div id="comp_Run" class="comp" style="display:none" >
    <div class="comp_name">Run</div>
    <div class="comp_desc">Provides alternative ways of calling a function.</div>
    <pre class="brush: js">
	
// Run plugin provides alternate way to call a function for fluid syntax.
// Notes: 
// 1. The keyword &quot;function&quot; can be aliased with the word &quot;step&quot;
// 2. The name of a function can be in quotes with spaces.

// This is a function with 0 parameters so parentheses are not required
step Cleanup
{
    // do something here.
}
 

// This is a function with string for name and 0 parameters so parentheses are not required
step &apos;Clean up&apos;
{
    // do something here.
}

// Example 1: Call function normally
Cleanup();

// Example 2: Call function using Run keyword
run Cleanup();

// Example 3: Call function using run without parenthesis for function name.
run Cleanup;

// Example 4: Call function with spaces in name using run with quotes for function name.    
run &apos;Clean up&apos;;

// Example 5: Call function with spaces using run and keyword.
run step &apos;Clean up&apos;;
	</pre>
</div><div id="comp_Set" class="comp" style="display:none" >
    <div class="comp_name">Set</div>
    <div class="comp_desc">Allows the word "set" to be used instead of "var" when declaring variables</div>
    <pre class="brush: js">
	
// Set plugin allows using the word &apos;set&apos; instead of &apos;var&apos; when declaring variables
    
set age = 33
	</pre>
</div><div id="comp_Sort" class="comp" style="display:none" >
    <div class="comp_name">Sort</div>
    <div class="comp_desc">Provides ability to sort of list of either basic types of objects with properties.</div>
    <pre class="brush: js">
	
// Sort plugin allows you to sort a list

// Case 1: sort list of basic types
var numbers = [4, 3, 1, 7, 5, 2, 6];
sort numbers asc
sort numbers desc

// Case 2: start with source &lt;books&gt; and system auto creates variable &lt;book&gt;
var books = [ 
                { name: &apos;book 1&apos;, pages: 200, author: &apos;homey&apos; },
                { name: &apos;book 2&apos;, pages: 120, author: &apos;kdog&apos; },
                { name: &apos;book 3&apos;, pages: 140, author: &apos;homeslice&apos; }
            ];     
sort books by book.pages asc
sort books by book.pages desc
sort i in books by i.pages desc
 
	</pre>
</div><div id="comp_Step" class="comp" style="display:none" >
    <div class="comp_name">Step</div>
    <div class="comp_desc">Allows the word "step" to be used instead of "function" when declaring functions. </div>
    <pre class="brush: js">
	
// Step plugin allows the word &quot;step&quot; to be used instead of &quot;function&quot; when declaring functions.
    
step add( a, b ) 
{ 
    return a + b
}
	</pre>
</div><div id="comp_Suffix" class="comp" style="display:none" >
    <div class="comp_name">Suffix</div>
    <div class="comp_desc">Provides enables the use of functions as postfix operators on constants</div>
    <pre class="brush: js">
	
// Suffix plugin enables the use of functions as postfix operators on constants.

// create hours with timespan object using number of hours supplied
function hours( num )
{
     return new TimeSpan( 0, num, 0 , 0 )
}

// create minutes with timespan object using number of minutes supplied
function minutes( num )
{
    return new TimeSpan(0, 0, num, 0 )
}

// timespan objects can be added together
var time = 3 hours + 20 minutes;
 
	</pre>
</div><div id="comp_Swap" class="comp" style="display:none" >
    <div class="comp_name">Swap</div>
    <div class="comp_desc">Provides ability to swap values of 2 variables in 1 statement e.g swap a with b;</div>
    <pre class="brush: js">
	
// Swap plugin provides 1 line statement to swap variables.

var a = 1, b = 2;

// Swap values in 1 statement.
// Instead of needing a third variable.
swap a with b;
	</pre>
</div><div id="comp_Time" class="comp" style="display:none" >
    <div class="comp_name">Time</div>
    <div class="comp_desc">Provides time representation in format 12:30 pm</div>
    <pre class="brush: js">
	
// Time plugin provides a convenient way to represent time in fluent syntax.

var t = 12:30 pm;

if t is 12:30 pm then
    print it&apos;s time to go to lunch!	
    // Time plugin provides a convenient way to represent time in fluent syntax.
    
    var t = 12:30 pm;
    
    if t is 12:30 pm then
	    print it&apos;s time to go to lunch!
	</pre>
</div><div id="comp_TypeOf" class="comp" style="display:none" >
    <div class="comp_name">TypeOf</div>
    <div class="comp_desc">Provides checking of data types</div>
    <pre class="brush: js">
	
// Type of plugins gets the type of an expression.

function inc(a) { return a + 1; }

dataType = typeof &apos;fluentscript&apos;    // &apos;string&apos;
dataType = typeof 12                // &apos;number&apos;
dataType = typeof 12.34             // &apos;number&apos;
dataType = typeof true              // &apos;boolean&apos;
dataType = typeof false             // &apos;boolean&apos;
dataType = typeof new Date()        // &apos;datetime&apos;
dataType = typeof 3pm               // &apos;time&apos;
dataType = typeof [0, 1, 2]         // &apos;object:list&apos;
dataType = typeof { name: &apos;john&apos; }  // &apos;object:map&apos;   
dataType = typeof new User(&apos;john&apos;)  // &apos;object:ComLib.Lang.Tests.Common.User&apos;
dataType = typeof inc               // &apos;function:inc&apos;
	</pre>
</div><div id="comp_Units" class="comp" style="display:none" >
    <div class="comp_name">Units</div>
    <div class="comp_desc">Provides usage of units of measure such as length, weight</div>
    <pre class="brush: js">
	 
 // Units plugin allows the usage of units of measure such as length, weight
 
 enable units;

 // inches, bytes are base types. everything is relative to the base types
 // In examples below, the units will get converted to the measurement on the
 // left hand side. e.g. 3 feet + 5 inches will get converted to datatype
 // LUnit with value in feet and basevalue in inches.    
 var result1 = 3 feet + 5 inches + 10 yards + 2 miles
 var result2 = 1 meg + 30 kb + 50 B + 2 gigs

 // Each unit of measure is based on a basevalue with a relative value.
 // e.g. 
 // type             basevalue   relative values
 // length           inches      feet, yard, mile
 // weight           ounces      milligrams, grams, kilograms
 // computerspace    bytes       kilobytes, megabytes, gigabytes

 print feet: #{result1.Value} , inches: #{result1.BaseValue}
 print megs: #{result2.Value} , bytes:  #{result2.BaseValue}
  
	</pre>
</div><div id="comp_Uri" class="comp" style="display:none" >
    <div class="comp_name">Uri</div>
    <div class="comp_desc">Provides url and folder representations as strings without quotes.</div>
    <pre class="brush: js">
	
// Uri plugin allows you urls and file paths without surrounding them in 
// quotes as long as there are no spaces. These are interpreted as strings.

var url1 = www.yahoo.com;
var url2 = http://www.google.com;
var url3 = http://www.yahoo.com?user=kishore%20&amp;id=123;
var file1 = c:\users\kishore\settings.ini;
var file2 = c:/data/blogposts.xml;

// Since this file has a space in it... you have to surround in quotes.
var file3 = &apos;c:/data/blog posts.xml&apos;;
	</pre>
</div><div id="comp_VariablePath" class="comp" style="display:none" >
    <div class="comp_name">VariablePath</div>
    <div class="comp_desc">Provides representation of file paths in more convenient ways.</div>
    <pre class="brush: js">
	
// Provides representation of file paths in more convenient ways

// Set the home dir
home    = c:\myapp\
script  = &quot;build&quot;

// Case 1: Typical approach
file = home + &quot;\\build\\build.xml&quot;    

// Case 2: VariablePath plugin simple case
// The @@ is optional on the first variable in the path.
file = home\build\script.xml
file = @@home\build\script.xml
 
// Case 3: Use variables in the path by prefixing @@
file = @@home\build\@@script.xml
file = @@home\build\@@script-build.xml
file = @@home\build\@@script.build.xml
 
// Case 4: Use variables by prefixing with @@ and surrounding by {}
// This is only needed when separating a variable name from another variable name.
file = @@home\build\@@{script}build.xml
file = @@home\build\@@{script}-build.xml
file = @@home\build\@@{script}.build.xml
 
 
// NOTE:
// This plugin is useful since the beginning drive letter ( &quot;c:\&quot; or &quot;d:\&quot; )
// should NOT be hardcoded. This plugin removes the need to:
// 1. use &quot;+&quot; for appending parts of the path
// 2. use doublequotes for wrapping the path name e.g. &quot;\build\appbuild.fs&quot;
	</pre>
</div><div id="comp_Version" class="comp" style="display:none" >
    <div class="comp_name">Version</div>
    <div class="comp_desc">Version plugin enables representation of versions using format 1.2.3.4.</div>
    <pre class="brush: js">
	
// Version plugin enables representation of versions using format 1.2.3.4.
// This is particularily useful for when fluentscript is used for build automation.
// e.g. 0.9.8.7

version  = 0.9.8.7
version2 = 0.9.8

print( version.Major )
print( version.Minor )
print( version.Revision )
print( version.Build )
	</pre>
</div><div id="comp_Words" class="comp" style="display:none" >
    <div class="comp_name">Words</div>
    <div class="comp_desc">Provides ability to use multi-word strings. e.g fluent script = 'fluent script'</div>
    <pre class="brush: js">
	
// Words plugin enables the registration of custom text/words into the language
// which are then immediately available for use. 
// They are basically an alternative to not having to surround text in double quotes
// Only 
@@words( nasdaq, fluent script )

if ( &quot;fluent script&quot; == fluent script ) then
    print( &quot;works&quot; )
	</pre>
</div>
    </div>
</div>

<script type="text/javascript">

    var _examples = [
        {	
            id: "variables_1",
            name: "Using variables",
            description: "Shows how to use simple variables",
            level: 1,		
            order: 1,
            code: "",
            tags: "var set variables",
            plugins: "NA",
            type: "ComLib.Lang.Extensions.AliasPlugin",
            file: "http://fluentscript.codeplex.com/SourceControl/changeset/view/83734#1349987"	
        },
        {	
            id: "variables_2",
            name: "Using variables",
            description: "Shows how to use simple variables",
            level: 1,
            order: 1,
            code: "",
            tags: "var set variables",
            plugins: "NA",
            type: "ComLib.Lang.Extensions.AliasPlugin",
            file: "http://fluentscript.codeplex.com/SourceControl/changeset/view/83734#1349987"	
        }
    ];
    
    var _lastCompSelected = "";

    // Handler for when the example component is changed.
    function Comp_OnChange() {
        var comp = document.getElementById("componentList");
        var text = comp.options[comp.selectedIndex].text;
        var val = comp.options[comp.selectedIndex].value;

        Comp_HideLast();

        _lastCompSelected = val;
        $("#" + _lastCompSelected).show();
    }



    // Hides the last component example.
    function Comp_HideLast() {
        if (_lastCompSelected != "") {
            $("#" + _lastCompSelected).hide();
        }
    }


    // Initialize the syntax highlight.
    $(document).ready(function() {
        SyntaxHighlighter.all();
    });
    
</script>

<!-- Include required JS files -->
<script type="text/javascript" src="/Content/lib/external/syntaxhighlighter/scripts/shCore.js"></script>
<!--
    At least one brush, here we choose JS. You need to include a brush for every 
    language you want to highlight
-->
<script type="text/javascript" src="/Content/lib/external/syntaxhighlighter/scripts/shBrushJScript.js"></script>
 
<!-- Include *at least* the core style and default theme -->
<link href="/Content/lib/external/syntaxhighlighter/styles/shCore.css" rel="stylesheet" type="text/css" />
<link href="/Content/lib/external/syntaxhighlighter/styles/shThemeDefault.css" rel="stylesheet" type="text/css" />
